//
//  FLLAttentionViewController.m
//  FLLGodOfCooking
//
//  Created by LL.F on 16/9/2.
//  Copyright © 2016年 LL.F. All rights reserved.
//

#import "FLLAttentionViewController.h"
#import "ZWYNetTool.h"
#import "FLLAttentionModel.h"
#import "AttentionData.h"
#import "AttentionSecData.h"
#import "AttentionTopics.h"
#import "AttentionLike.h"
#import "AttentionComment.h"
#import "AttentionParents.h"
#import "Masonry.h"
#import "UILabel+FLLSetPropety.h"

@interface FLLAttentionViewController ()
@property (nonatomic, strong) UIView *noFoundView;
@property (nonatomic, strong) UIImageView *noFoundImage;
@property (nonatomic, strong) UILabel *noFoundLabel;
@property (nonatomic, strong) FLLAttentionModel *fllAttentionModel;
@end

@implementation FLLAttentionViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self createPOSTRequest];
    // 假界面
    [self createNoFoundView];
    
    

}
- (void)createPOSTRequest
{
    [ZWYNetTool POST:@"http://api.izhangchu.com/ HTTP/1.1" andBody:@"page=1&methodName=ShequFollow&size=20&version=4.40&" andBodyStyle:ZWYBodyString andHeader:@{@"Content-Type":@"application/x-www-form-urlencoded; charset=utf-8"} andResponse:ZWYJSON andSuccessBlock:^(id result) {
        
        self.fllAttentionModel = [FLLAttentionModel modelWithDic:result];
       
//        [self.newestCollectionView reloadData];
        
    } andFailureBlock:^(NSError *error) {
        
    }];
    
}
- (void)createNoFoundView
{
    self.noFoundView = [[UIView alloc] init];
    [self.view addSubview:_noFoundView];
    [_noFoundView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.mas_equalTo(0);
    }];
    self.noFoundImage = [[UIImageView alloc] init];
    _noFoundImage.image = [UIImage imageNamed:@"noFound"];
    [_noFoundView addSubview:_noFoundImage];
    [_noFoundImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(177 / 2.0);
        make.width.mas_equalTo(117 / 2.0);
        make.centerX.mas_equalTo(0);
        make.centerY.mas_equalTo(self.view.mas_centerY).multipliedBy(0.8);
    }];
    self.noFoundLabel = [[UILabel alloc] init];
    _noFoundLabel.text = @"网络不给力, 请检查网络, 点击屏幕重试!";
    _noFoundLabel.numberOfLines = 0;
    [_noFoundView addSubview:_noFoundLabel];
    [_noFoundLabel setPropetyWithTextColor:[UIColor blackColor] Alignment:1 textFont:[UIFont systemFontOfSize:17]];
    [_noFoundLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(0).multipliedBy(1.1);
        make.centerX.mas_equalTo(0);
        make.width.mas_equalTo(200);
    }];
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
